<include file='Admin/Tpl/Public/nav.html' />
<style type="text/css">
.currenta{background-color:white}
</style>
  <div id="main-content">
    <div class="content-box">
      <div class="content-box-header">
        <ul class="content-box-tabs">
          <li><a href="#tab1" class="default-tab"> 列 表 </a></li>
          <li><a href="#tab2"> 添 加 </a></li>
        </ul>
        <div class="clear"></div>
      </div>
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
          <div style="margin:0px 0 10px 0; float:left">
          <form action="__APP__/Admin/Admin/index" method="get">
            <input type="text" name="seach" class="text-input" style="color:#CCCCCC; width:220px" id="seach" />
            <input type="submit" class="button" value="搜索" />
            <input type="button" onclick="javascript:window.location='__URL__'" class="button" value="重置" />
          </form>
        </div>
          <table>
            <thead>
              <tr>
                <td style="text-align:center; width:60px">编号</td>
                <td style="text-align:center;">用户名</td>
                <td style="text-align:center;">密码</td>
                <td style="text-align:center; width:220px">管理</td>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="6">
                  <div class="bulk-actions align-left"></div>
                  <div class="pagination">{$rs.show}</div>
                  <div class="clear"></div>
                </td>
              </tr>
            </tfoot>
            <tbody>
			<volist name='rs.data' id='val'>
              <tr>
                <td style="text-align:center; line-height:25px">{$val.id}</td>
                <td style="text-align:center">{$val.username}</td>
                <td style="text-align:center">{$val.pwd}</td>
				<td style="text-align:center">
					<a href="__URL__/Admin/to_upt?id={$val.id}" title="Edit">修改</a>&nbsp;|&nbsp; 
					<a href="javascript:void(0)" title="Delete" onclick="javascript:del_data({$val.id})">删除</a>
              </tr>
			</volist>
            </tbody>
          </table>
        </div>
        <div class="tab-content" id="tab2" style="display:none;">
          <form method="post" action="__APP__/Admin/Admin/add_admin">
            <fieldset>
			<table>
				<tr>
					<td width="15%" style="font-weight:bold">用户名:</td>
					<td><input class="text-input small-input" type="text" name="username" /></td>
				</tr>
				<tr>
					<td width="15%" style="font-weight:bold">密码:</td>
					<td><input class="text-input small-input" type="text" name="pwd" /></td>
				</tr>
			</table>
            <p>
              <input class="button" type="submit" id="submit" value="Submit" />
            </p>
            </fieldset>
            <div class="clear"></div>
			</fieldset>
          </form>
        </div>
      </div>
    </div>
    <div class="clear"></div>
</div>
</body>
</html>
<script type="text/javascript">
function del_data(id){
	if(confirm('确认删除?')){
		$.ajax({
			type:'get',
			url:'__APP__/Admin/Admin/del_admin?id='+id,
			dataType:'json',
			success: function(data){
				alert(data.msg);
				if(data.code==1){
					window.location='__SELF__';		
				}
			}
		});	
	}
}
</script>
